﻿<Window x:Class="RealEstateListingViewer.Views.RealEstateListingView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:pie="clr-namespace:PieChartLibrary;assembly=PieChartLibrary"
    Title="RealEstateListingView" Width="600" Height="480">
    <Grid Background="White" Margin="10,0,10,0">
        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="200"/>
            <RowDefinition Height="90" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width=".7*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <StackPanel Grid.Row="0" Grid.Column="0" Orientation="Horizontal">
            <TextBlock Text="{Binding Path=Address}" AutomationProperties.AutomationId="AddressAboveHouseImageTextBlock" />
            <TextBlock Text=", "/>
            <TextBlock Text="{Binding Path=County}" AutomationProperties.AutomationId="CountyAboveHouseImageTextBlock" />
            <TextBlock Text=", "/>
            <TextBlock Text="{Binding Path=State}" AutomationProperties.AutomationId="StateAboveHouseImageTextBlock" />
        </StackPanel>

        <StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
            <TextBlock Text="$ "/>
            <TextBlock Text="{Binding Path=Price}" AutomationProperties.AutomationId="PriceTextBlock" />
        </StackPanel>

        <Border Grid.Row="1" Grid.ColumnSpan="2" BorderBrush="Black"  BorderThickness="1" Margin="0,5,0,5">
            <Image Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Path=PropertyImage}" AutomationProperties.AutomationId="PropertyImage"/>
        </Border>

        <StackPanel Grid.Row="2" Grid.Column="0">
            <TextBlock Text="{Binding Address}" AutomationProperties.AutomationId="AddressBelowHouseImageTextBlock" />
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding County}" AutomationProperties.AutomationId="CountyBelowHouseImageTextBlock"  />
                <TextBlock Text=", "/>
                <TextBlock Text="{Binding State}" AutomationProperties.AutomationId="StateBelowHouseImageTextBlock" />
                <TextBlock Text=" " />
                <TextBlock Text="{Binding ZipCode}" AutomationProperties.AutomationId="ZipCodeTextBlock" />
            </StackPanel>

            <StackPanel Orientation="Horizontal">
                <Border BorderBrush="Black" BorderThickness="1" Margin="5,5,5,5">
                    <StackPanel>
                        <Image Source="pack://siteOfOrigin:,,,/Images/Bathrooms.jpg" Width="35" Height="35" AutomationProperties.AutomationId="BathroomsImage"/>
                        <TextBlock HorizontalAlignment="Center" Text="{Binding Bathrooms}" AutomationProperties.AutomationId="BathroomsTextBlock"/>
                    </StackPanel>
                </Border>
                <Border BorderBrush="Black" BorderThickness="1" Margin="5,5,5,5">
                    <StackPanel>
                        <Image Source="pack://siteOfOrigin:,,,/Images/Bedrooms.jpg" AutomationProperties.AutomationId="BedroomsImage" Width="35" Height="35"/>
                        <TextBlock HorizontalAlignment="Center" Text="{Binding Bedrooms}" AutomationProperties.AutomationId="BedroomsTextBlock"/>
                    </StackPanel>
                </Border>
                <Border BorderBrush="Black" BorderThickness="1" Margin="5,5,5,5">
                    <StackPanel>
                        <Image Source="pack://siteOfOrigin:,,,/Images/Garage.jpg" AutomationProperties.AutomationId="GarageImage" Width="35" Height="35"/>
                        <TextBlock HorizontalAlignment="Center" Text="{Binding GarageSize}" AutomationProperties.AutomationId="GarageSizeTextBlock"/>
                    </StackPanel>
                </Border>
                <Border BorderBrush="Black" BorderThickness="1" Margin="5,5,5,5">
                    <StackPanel>
                        <Image Source="pack://siteOfOrigin:,,,/Images/Acreage.jpg" Width="35" Height="35" AutomationProperties.AutomationId="AcerageImage"/>
                        <TextBlock HorizontalAlignment="Center" Text="{Binding Acreage}" AutomationProperties.AutomationId="AcerageTextBlock" />
                    </StackPanel>
                </Border>
            </StackPanel>
        </StackPanel>

        <Border Grid.Row="2" Grid.Column="1" Grid.RowSpan="2" BorderBrush="Black" HorizontalAlignment="Right" VerticalAlignment="Top"  BorderThickness="1" Margin="10,10,10,10" Width="120" Height="200" ClipToBounds="True">
            <pie:PieChart Center="60.0, 60.0" Radius="45.0" Sections="{Binding Path=Sections}" LabelsFontSize="10.0" StrokeThickness="0.5" AutomationProperties.AutomationId="PieSectionTextBlock" />
        </Border>

        <StackPanel Grid.Row="3" Grid.Column="0">
            <TextBlock Text="{Binding Path=DescriptionLabel, Source={StaticResource LocStrs}}" Margin="0,10,0,5" AutomationProperties.AutomationId="DescriptionLabelTextBlock" />
            <TextBlock Text="{Binding Path=Description}" TextWrapping="Wrap" AutomationProperties.AutomationId="DescriptionTextBlock" />
        </StackPanel>
    </Grid>
</Window>
